//
//  WSFindBaseCell.m
//  LANGirl
//
//  Created by 杨泓晔 on 16/3/10.
//  Copyright © 2016年 杨泓晔. All rights reserved.
//

#import "WSFindBaseCell.h"

@interface WSFindBaseCell ()

@property (nonatomic, strong) UIView *myBackimageView;

@end

@implementation WSFindBaseCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.myBackimageView = [UIView new];
        [self.contentView addSubview:self.myBackimageView];
        self.myBackimageView.backgroundColor = [UIColor whiteColor];
        //裁掉边框
        self.myBackimageView.layer.masksToBounds = YES;
        //设置半径
        self.myBackimageView.layer.cornerRadius = 6 *AUTO_WIDTH;
        [self.myBackimageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.bottom.left.right.mas_equalTo(@0);
        }];
        self.myBackimageView.layer.borderWidth=1.0;
        //边框颜色
        self.myBackimageView.layer.borderColor=COLOR_FRAME;
        
        [self createHeadingLabel];
        [self createLineView];
    }
    return self;
}

- (void)createHeadingLabel {

    self.headingLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_headingLabel];
    self.headingLabel.alpha = 0.74;
    [self.headingLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(@0);
        make.left.mas_equalTo(@(9 * AUTO_WIDTH));
        make.right.mas_equalTo(@(-50 * AUTO_WIDTH));
        make.height.mas_equalTo(@(40 * AUTO_WIDTH));
    }];
    self.headingLabel.textColor = [UIColor blackColor];
    self.headingLabel.font = [UIFont systemFontOfSize:LOGINFONT *TEXTWEIGHT];
}

- (void)createLineView {

    self.lineView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"虚线"]];
    [self addSubview:_lineView];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.headingLabel.mas_bottom);
        make.left.mas_equalTo(@8);
        make.right.mas_equalTo(@-8);
        make.height.mas_equalTo(@1);
    }];
    
}

@end
